package com.kun.portal.webframe.controller;

import com.kun.portal.webframe.po.AirSecurityVehiclePo;
import com.kun.portal.webframe.service.AirSecurityVehicleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by Administrator on 2018-08-01.
 *
 * 机场保障车辆
 */
@Controller
@RequestMapping({"/api/airSecurityVehicle"})
public class AirSecurityVehicleController {
    @Autowired
    private AirSecurityVehicleService airSecurityVehicleService;

    @RequestMapping(
            value = {"/findAllASV"},
            method = {RequestMethod.GET},
            produces = {"application/json"}
    )
    @ResponseBody
    public List<AirSecurityVehiclePo> findAllASV(){
        return airSecurityVehicleService.findAllAirSecurityVehiclePo();
    }
    @RequestMapping(
            value = {"/checkASV"},
            method = {RequestMethod.GET},
            produces = {"application/json"}
    )
    @ResponseBody
    public  List<AirSecurityVehiclePo> checkASV(@RequestParam(required = false) String vehicleType ,
                                                         @RequestParam(required = false) String vehicleState ){
        return airSecurityVehicleService.checkASV(vehicleType,vehicleState);
    }
    @RequestMapping(
            value = {"/saveASV"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public void saveASV(@RequestBody AirSecurityVehiclePo airSecurityVehiclePo){
        airSecurityVehicleService.saveASV(airSecurityVehiclePo);
    }
    @RequestMapping(
            value = {"/delectASV"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public void deleteASV(@RequestBody AirSecurityVehiclePo airSecurityVehiclePo){
        airSecurityVehicleService.deleteASV(airSecurityVehiclePo);
    }



}
